<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="${application.USM_CONTEXT_FULLNAME} +' | 登录'"></title>
<meta name="_csrf" th:content="${_csrf.token}" />
<meta name="_csrf_header" th:content="${_csrf.headerName}" />
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css" />
<link rel="stylesheet" th:href="@{/statics/dist/css/AdminLTE.min.css}" />
<link rel="stylesheet" th:href="@{/statics/plugins/iCheck/square/blue.css}" />
<script type="text/javascript">
	if (window != top) {
		top.location.href = location.href;
	}
</script>
</head>
<body class="hold-transition login-page">
	<div class="login-box">
		<div class="login-logo">
			<b th:text="${application.USM_CONTEXT_FULLNAME}">KYE</b>
		</div>
		<!-- /.login-logo -->
		<div class="login-box-body">
			<p class="login-box-msg">登录</p>
			<div
				th:if="${session.SPRING_SECURITY_LAST_EXCEPTION != null and session.SPRING_SECURITY_LAST_EXCEPTION.message != null}"
				class="callout callout-danger"
				th:text="${session.SPRING_SECURITY_LAST_EXCEPTION.message eq 'Bad credentials' ? '账号或密码错误，请重试  ' : session.SPRING_SECURITY_LAST_EXCEPTION.message}">
				账号或密码错误，请重试</div>
			<form th:action="@{/login}" method="post">
				<div class="form-group has-feedback">
					<input type="text" class="form-control" placeholder="用户名" name="username" required="required" value="" /> <span
						class="glyphicon glyphicon-user form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback">
					<input type="password" class="form-control" placeholder="密码" name="password" required="required" value="" /> <span
						class="glyphicon glyphicon-lock form-control-feedback"></span>
				</div>

				<div class="form-group has-feedback" th:if="${session.USM_VERIFICATIONCODE_ENABLED}">
					<input type="text" class="form-control" placeholder="验证码" name="kaptcha" required="required"
						onkeyup="this.value=this.value.replace(/\W/g,'')" onafterpaste="this.value=this.value.replace(/\W/g,'')" /> <span
						class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
				</div>
				<div class="form-group has-feedback" th:if="${session.USM_VERIFICATIONCODE_ENABLED}">
					<img id="refreshCode" alt="如果看不清楚，请单击图片刷新！" class="pointer" th:src="@{/except/kaptcha}" />
					&nbsp;&nbsp;&nbsp;&nbsp;<a id="dynamic-code" href="javascript:;">点击刷新</a>
				</div>

				<div class="row">
					<div class="col-xs-8">
						<div class="checkbox icheck">
							<label> <input type="checkbox" name="remember-me" /> 记住我
							</label>
						</div>
					</div>
					<!-- /.col -->
					<div class="col-xs-4">
						<button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
					</div>
					<!-- /.col -->
				</div>
			</form>
		</div>
		<!-- /.login-box-body -->
	</div>
	<!-- /.login-box -->
	<script th:src="@{/statics/bower_components/jquery/dist/jquery.min.js}"></script>
	<script th:src="@{/statics/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>
	<script th:src="@{/statics/plugins/iCheck/icheck.min.js}"></script>
	<script type="text/javascript">
		$(function() {
			$('input').iCheck({
				checkboxClass : 'icheckbox_square-blue',
				radioClass : 'iradio_square-blue',
				increaseArea : '20%' // optional
			});
			$("#dynamic-code, #refreshCode").click(
					function() {
						$("#refreshCode").attr("src",
								'except/kaptcha' + "?" + Math.random());
					});
		});
	</script>
</body>
</html>
